#include <iostream>
using namespace std;

// 返回当前数转化为二进制后包含1的个数
int func(int x)
{
    int count = 0;
    while (x)
    {
        count++;
        x = x & (x - 1);
    }
    return count;
}

int main()
{
    cout<<func(9999)<<endl;
    return 0;
}